home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / sm32a.zip / SYMBMATH.H49 < prev    next >
Text File  |  1994-12-22  |  3KB  |  84 lines

  1.         5.2.  Plotting y = f(x)
  2.     You can plot a function of y = f(x) on the xy-plane by a single 
  3. external function
  4.  
  5.         plot(f(x),x)
  6.                 plot(f(x),x,xmin,xmax)
  7.                 plot(f(x),x,xmin,xmax,ymin,ymax)
  8.                 plot(f(x),x,xmin,xmax,ymin,ymax,color)
  9.  
  10. f(x) can be either a function  with bound variable x or an expression
  11. involving x.  For example, you could graph the parabola with the command
  12. plot(x^2,x).  
  13.      The xmin and xmax are range of x-axis, the ymin and ymax are range of
  14. y-axis. The default values are xmin=-5, xmax=5, ymin=-5, and ymax=5.
  15. The values of xmin, xmax, ymin, ymax are real numbers, such that  
  16. xmin < xmax  and  ymin < ymax.  Thses values tell SymbMath that the 
  17. visible screen corresponds to a portion of the xy-plane with  
  18. xmin <= x <= xmax  and  ymin <= y <= ymax. 
  19.      The operator plot() plots one point (x,f(x)) for each pixel on the
  20. x-axis, and connects successive points.  To omit the connections and just
  21. plot the points, use the command:
  22.             dotplot(f(x),x)
  23.      To plot only every 20th point, which is useful for rapidly
  24. graphing complicated functions, use
  25.             sketch(f(x),x)
  26.      If you want your circles and squares to look correct --
  27. that is, if you want one vertical unit to be really the same
  28. distance as one horizontal unit--you should select window
  29. parameters so that the horizontal axis is 1.4 times as long as
  30. the vertical axis.
  31.     Example 5.2:                
  32.     plot x^3 and sin(x).
  33. IN:  graph
  34. IN:  plot(x^3,x)                
  35. IN:  plot(sin(x),x)
  36.  
  37.                 5.3  Plotting parametric functions x=x(t) and y=y(t)
  38.      You can plot the parametric functions of x=x(t) and y=y(t) by
  39.         paraplot(x(t),y(t),t)
  40.                 paraplot(x(t),y(t),t,tmin,tmax)
  41.                 paraplot(x(t),y(t),t,tmin,tmax,ymin,ymax)
  42.      e.g.
  43. IN:  graph
  44. IN:  paraplot(sin(t),sin(2*t),t)
  45.  
  46.  
  47.                 5.4    Plotting r = f(t) in polar coordinates
  48.      You can graph the portion of a polar curve  r = f(t) that lies in
  49. the window with a single external function:
  50.  
  51.                        polaplot(f(t),t)
  52.                        polaplot(r, t,tmin,tmax)
  53.                        polaplot(r, t,tmin,tmax,rmin,rmax)
  54.  
  55. f(t) can be a function with bound variable t or an expression involving t.
  56. For example, to graph a circle  r = 1, execute the command
  57.                        polaplot(1,t)
  58. The variable t covers the domain (0, 2π); you can change this default by
  59. specifying a range for t:
  60.                        polaplot(1, t,0,pi)
  61.  
  62.                5.5  Plotting data
  63.         You can plot data by
  64.           dataplot([x1,x2,...], [y1,y2,...])
  65.           dataplot([x1,x2,...], [y1,y2,...], xmin,max)
  66.           dataplot([x1,x2,...], [y1,y2,...], xmin,xmax,ymin,ymax)
  67.           dataplot([x1,x2,...], [y1,y2,...], xmin,xmax,ymin,ymax,link)
  68.         e.g.
  69. IN:  graph
  70. IN:  dataplot([1,2,3], [1,4,9])
  71.  
  72.         You can plot a list of data by
  73.                listplot([y1,y2,...])
  74. for x1=1, x2=2, x3=3, ....
  75.         e.g.
  76. IN:  graph
  77. IN:  listplot([1,4,9])
  78.  
  79.     You can fit a set of data into a function x^2
  80.     e.g.
  81. IN:  graph
  82. IN:  dataplot([1,2,3,4],[1,4,9,16],0,5,0,20)
  83. IN:  plot(x^2,x,0,5,0,20)
  84.